//
//  EnemyFighterSprite.h
//  airfight
//
//  Created by USER on 12-9-13.
//  Copyright (c) 2012年 moonriver. All rights reserved.
//

#ifndef airfight_EnemyFighterSprite_h
#define airfight_EnemyFighterSprite_h

#include "env.h"
#include "EnemyPrototypes.h"
#include "BonusPrototypes.h"
#include "Enemy.h"
#include "EntitySprite.h"
#include "EnemyBulletSprite.h"
#include "PlayerFighterSprite.h"
#include "Bullet.h"
#include "Bonus.h"
#include "BonusSprite.h"


enum enemy_toDestoryFlag
{
    ENEMY_DESTROY_OUT = 1,
    ENEMY_DESTROY_DIE = 2,
    ENEMY_DESTROY_BOSS = 3
};

class EnemyFighterSprite : public EntitySprite
{
    CC_SYNTHESIZE(int,m_pFighterId,FighterId);
    CC_SYNTHESIZE(int,m_pBlood,Blood); //血量
    CC_SYNTHESIZE(int,m_pArmor,Armor); //护甲
    CC_SYNTHESIZE(int,m_pTraceID,TraceID); //移动id
    CC_SYNTHESIZE(int,m_pBonusID,BonusID); //掉落物id
    CC_SYNTHESIZE(int,m_pIsBoss,IsBoss); //是否BOSS
    
private:
    CCSpriteBatchNode *batch;
    CCPoint m_enterPos; //发射点
    PlayerFighterSprite *m_playerFighter;
    
    CCDictionary *bulletFireGroupNumDict;
public:
    CCDictionary *bulletDict;
public:
    EnemyFighterSprite(PlayerFighterSprite *p_playerFighter);
    ~EnemyFighterSprite();
    bool init();
    void onEnter();
    void update(float dt);
    inline CCPoint getEnterPos() { return m_enterPos; }
    inline void setEnterPos(int x,int y) { m_enterPos = CCPointMake(x,y); }
    EnemyBulletSprite* createEnemyBulletSprite(int p_bulletID);
    void handleContact(ENTITY_TYPE type, CCDictionary *effect);
    
    int m_iFrameIndex;
    ccColor3B m_OldColor;
    bool m_bBossDestroyed;
};

#endif
